package is.glif.fenius.webui.db;


import java.util.List;

import is.glif.fenius.webui.db.bean.CompositeReservation;

import org.hibernate.Session;

public class CompositeReservationDAO {
    
    public void create(CompositeReservation resv) {
        Session session = HibernateSessionUtil.getSessionfactory().openSession(); 
        session.getTransaction().begin(); 
        session.save(resv);
        session.getTransaction().commit(); 
        session.close();

    }
    
    @SuppressWarnings("unchecked")
    public List<CompositeReservation> findAll() { 
        Session session = HibernateSessionUtil.getSessionfactory().openSession(); 
        List<CompositeReservation> list = (List<CompositeReservation>) session.createQuery("From CompositeReservation").list(); 
        
        return list;
    }
    
}
